inherited fmSec: TfmSec
  Left = -1
  Top = 138
  Width = 1280
  Height = 900
  Caption = 'fmSec'
  DefaultMonitor = dmDesktop
  WindowState = wsMaximized
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel [0]
    Left = 58
    Top = 44
    Width = 123
    Height = 16
    Caption = #1042#1074#1077#1076#1080#1090#1077' '#1092#1072#1084#1080#1083#1080#1102
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label2: TLabel [1]
    Left = 304
    Top = 541
    Width = 166
    Height = 16
    Caption = #1050#1086#1085#1090#1072#1082#1090#1085#1072#1103' '#1080#1085#1092#1086#1088#1084#1072#1094#1080#1103
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label3: TLabel [2]
    Left = 648
    Top = 541
    Width = 170
    Height = 16
    Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1080' '#1086' '#1095#1077#1083#1086#1074#1077#1082#1077
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label4: TLabel [3]
    Left = 321
    Top = 413
    Width = 119
    Height = 16
    Caption = #1044#1086#1074#1077#1088#1077#1085#1085#1086#1077' '#1083#1080#1094#1086
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label5: TLabel [4]
    Left = 897
    Top = 413
    Width = 71
    Height = 16
    Caption = #1057#1086#1090#1088#1091#1076#1085#1080#1082
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label6: TLabel [5]
    Left = 585
    Top = 413
    Width = 124
    Height = 16
    Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label7: TLabel [6]
    Left = 673
    Top = 44
    Width = 180
    Height = 16
    Caption = #1042#1074#1077#1076#1080#1090#1077' '#1087#1088#1080#1095#1080#1085#1091' '#1087#1088#1086#1087#1091#1089#1082#1072
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label8: TLabel [7]
    Left = 1040
    Top = 541
    Width = 78
    Height = 16
    Caption = #1044#1086#1082#1091#1084#1077#1085#1090#1099
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label9: TLabel [8]
    Left = 8
    Top = 509
    Width = 137
    Height = 16
    Caption = #1051#1102#1076#1080' '#1085#1072' '#1090#1077#1088#1088#1080#1090#1086#1088#1080#1080
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  inherited sbBottom: TStatusBar
    Top = 839
    Width = 1272
  end
  inherited Panel1: TPanel
    Top = 794
    Width = 1272
    Align = alBottom
    TabOrder = 2
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 1249
    end
    inherited BitBtn2: TBitBtn
      Left = 1337
    end
  end
  object dbgClients: TcxGrid [11]
    Left = 8
    Top = 125
    Width = 1249
    Height = 273
    Align = alCustom
    TabOrder = 4
    LookAndFeel.Kind = lfStandard
    object tvPeople: TcxGridDBTableView
      OnKeyDown = tvPeopleKeyDown
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      OnCellClick = tvPeopleCellClick
      OnCellDblClick = tvPeopleCellDblClick
      OnCustomDrawCell = tvPeopleCustomDrawCell
      OnFocusedRecordChanged = tvPeopleFocusedRecordChanged
      DataController.DataModeController.GridMode = True
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <
        item
          Kind = skCount
          Position = spFooter
          FieldName = 'PLASTNAME'
        end>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.OnGetContentStyle = tvPeopleStylesGetContentStyle
      Styles.Header = DMInv.cxSiniyText
      object tvPeoplePP: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'PP'
        Width = 206
      end
      object tvPeoplePDATEBIRTH: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
        DataBinding.FieldName = 'PDATEBIRTH'
        Width = 97
      end
      object tvPeopleSEX: TcxGridDBColumn
        Caption = #1055#1086#1083
        DataBinding.FieldName = 'SEX'
        Width = 33
      end
      object tvPeopleMAX_DATA: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1087#1086#1089#1083'. '#1074#1080#1079'.'
        DataBinding.FieldName = 'MAX_DATA'
        Width = 94
      end
      object tvPeopleMIN_DATA: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1087#1077#1088#1074#1086#1075#1086' '#1074#1080#1079'.'
        DataBinding.FieldName = 'MIN_DATA'
        Width = 101
      end
      object tvPeoplePLASTNAME: TcxGridDBColumn
        DataBinding.FieldName = 'PLASTNAME'
        Visible = False
        Width = 2299
      end
      object tvPeopleTSEL_POSL_VIZ: TcxGridDBColumn
        DataBinding.FieldName = 'TSEL_POSL_VIZ'
        Width = 134
      end
    end
    object dbgClientsLevel1: TcxGridLevel
      GridView = tvPeople
    end
  end
  object cxLookupComboBox1: TcxLookupComboBox [12]
    Left = 56
    Top = 66
    ParentFont = False
    Properties.DropDownListStyle = lsEditList
    Properties.KeyFieldNames = 'PLASTNAME'
    Properties.ListColumns = <
      item
        Caption = #1060#1072#1084#1080#1083#1080#1103
        FieldName = 'PLASTNAME'
      end>
    Properties.ListSource = DataSource1
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -32
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 0
    OnKeyDown = cxLookupComboBox1KeyDown
    Width = 569
  end
  object cxGrid3: TcxGrid [13]
    Left = 304
    Top = 573
    Width = 321
    Height = 204
    Align = alCustom
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 5
    TabStop = False
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView3: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dsContInfo
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.ColumnAutoWidth = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBColumn1: TcxGridDBColumn
        DataBinding.FieldName = 'SDNAME'
        Options.Editing = False
        Width = 167
      end
      object cxGridDBColumn2: TcxGridDBColumn
        DataBinding.FieldName = 'CIVALUE'
        Options.Editing = False
        Width = 217
      end
      object cxGridDBColumn3: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
        DataBinding.FieldName = 'CINOTE'
        Options.Editing = False
        Styles.Content = DMInv.cxGreenText
        Width = 153
      end
    end
    object cxGridLevel6: TcxGridLevel
      GridView = cxGridDBTableView3
    end
  end
  object cxGrid2: TcxGrid [14]
    Left = 646
    Top = 573
    Width = 371
    Height = 204
    Align = alCustom
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 6
    TabStop = False
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView2: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      DataController.DataSource = dsComments
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      OptionsCustomize.ColumnFiltering = False
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.ColumnAutoWidth = True
      OptionsView.GroupByBox = False
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView2CVALUE: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
        DataBinding.FieldName = 'CVALUE'
        Width = 193
      end
      object cxGridDBTableView2FIO: TcxGridDBColumn
        Caption = #1040#1074#1090#1086#1088
        DataBinding.FieldName = 'FIO'
        Width = 114
      end
      object cxGridDBTableView2DATA: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1089#1086#1079#1076'.'
        DataBinding.FieldName = 'DATA'
        Width = 76
      end
    end
    object cxGridLevel2: TcxGridLevel
      GridView = cxGridDBTableView2
    end
  end
  object cxDBTextEdit1: TcxDBTextEdit [15]
    Left = 321
    Top = 437
    TabStop = False
    DataBinding.DataField = 'PP'
    DataBinding.DataSource = DataSource2
    ParentFont = False
    Properties.ReadOnly = True
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -16
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.LookAndFeel.Kind = lfStandard
    Style.IsFontAssigned = True
    StyleDisabled.LookAndFeel.Kind = lfStandard
    StyleFocused.LookAndFeel.Kind = lfStandard
    StyleHot.LookAndFeel.Kind = lfStandard
    TabOrder = 7
    Width = 241
  end
  object cxGrid1: TcxGrid [16]
    Left = 583
    Top = 437
    Width = 291
    Height = 97
    Align = alCustom
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 8
    TabStop = False
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView1: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      DataController.DataSource = DataSource3
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      OptionsCustomize.ColumnFiltering = False
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.ColumnAutoWidth = True
      OptionsView.GroupByBox = False
      OptionsView.Header = False
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView1PP: TcxGridDBColumn
        DataBinding.FieldName = 'PP'
      end
    end
    object cxGridLevel1: TcxGridLevel
      GridView = cxGridDBTableView1
    end
  end
  object cxDBTextEdit2: TcxDBTextEdit [17]
    Left = 897
    Top = 437
    TabStop = False
    DataBinding.DataField = 'PP'
    DataBinding.DataSource = dsSotr
    ParentFont = False
    Properties.ReadOnly = True
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -16
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.LookAndFeel.Kind = lfStandard
    Style.IsFontAssigned = True
    StyleDisabled.LookAndFeel.Kind = lfStandard
    StyleFocused.LookAndFeel.Kind = lfStandard
    StyleHot.LookAndFeel.Kind = lfStandard
    TabOrder = 9
    Width = 241
  end
  object cxLookupComboBox2: TcxLookupComboBox [18]
    Left = 671
    Top = 66
    ParentFont = False
    Properties.DropDownListStyle = lsEditList
    Properties.KeyFieldNames = 'SDNAME'
    Properties.ListColumns = <
      item
        Caption = #1055#1088#1080#1095#1080#1085#1072
        FieldName = 'SDNAME'
      end>
    Properties.ListSource = DataSource5
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -32
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 1
    Width = 569
  end
  object tbTop: TToolBar [19]
    Left = 0
    Top = 0
    Width = 1272
    Height = 37
    AutoSize = True
    BorderWidth = 2
    ButtonHeight = 25
    Images = DMInv.ilActive
    TabOrder = 10
    Transparent = True
    object tbInsert: TToolButton
      Left = 0
      Top = 2
      Hint = #1044#1086#1073#1072#1074#1080#1090#1100
      ImageIndex = 30
      ParentShowHint = False
      ShowHint = True
      OnClick = tbInsertClick
    end
    object tbEdit: TToolButton
      Left = 23
      Top = 2
      Hint = #1048#1079#1084#1077#1085#1080#1090#1100'/'#1055#1088#1086#1089#1084#1086#1090#1088#1077#1090#1100
      ImageIndex = 2
      ParentShowHint = False
      ShowHint = True
      OnClick = tbEditClick
    end
  end
  object cxGrid4: TcxGrid [20]
    Left = 1038
    Top = 572
    Width = 299
    Height = 205
    Align = alCustom
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 11
    TabStop = False
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView4: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      DataController.DataSource = dsDocuments
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      OptionsCustomize.ColumnFiltering = False
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.ColumnAutoWidth = True
      OptionsView.GroupByBox = False
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView1SDNAME: TcxGridDBColumn
        Caption = #1058#1080#1087' '#1076#1086#1082#1091#1084#1077#1085#1090#1072
        DataBinding.FieldName = 'SDNAME'
        Width = 469
      end
      object cxGridDBTableView1ISSCAN: TcxGridDBColumn
        Caption = #1050#1086#1087#1080#1103
        DataBinding.FieldName = 'ISSCAN'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ReadOnly = True
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = 0
        Width = 74
      end
    end
    object cxGridLevel3: TcxGridLevel
      GridView = cxGridDBTableView4
    end
  end
  object Panel2: TPanel [21]
    Left = 1264
    Top = 60
    Width = 145
    Height = 49
    Caption = #1053#1072' '#1090#1077#1088#1088#1080#1090#1086#1088#1080#1080
    Color = clGreen
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWhite
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 12
    Visible = False
  end
  object cxGrid5: TcxGrid [22]
    Left = 8
    Top = 573
    Width = 289
    Height = 204
    Align = alCustom
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 13
    TabStop = False
    LookAndFeel.Kind = lfStandard
    object tvVizit: TcxGridDBTableView
      OnKeyDown = tvVizitKeyDown
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dsInside
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'FIO'
          Column = tvVizitFIO
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsData.CancelOnExit = False
      OptionsData.Deleting = False
      OptionsData.DeletingConfirmation = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ShowEditButtons = gsebForFocusedRecord
      OptionsView.CellAutoHeight = True
      OptionsView.ColumnAutoWidth = True
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object tvVizitFIO: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'FIO'
        Width = 266
      end
      object tvVizitPVTIME_IN: TcxGridDBColumn
        Caption = #1044#1072#1090#1072'/'#1074#1088#1077#1084#1103' '#1074#1093#1086#1076#1072
        DataBinding.FieldName = 'PVTIME_IN'
      end
    end
    object cxGridLevel4: TcxGridLevel
      GridView = tvVizit
    end
  end
  object cxLookupComboBox3: TcxLookupComboBox [23]
    Left = 7
    Top = 533
    ParentFont = False
    Properties.DropDownListStyle = lsEditList
    Properties.KeyFieldNames = 'SDNAME'
    Properties.ListColumns = <
      item
        Caption = #1057#1090#1072#1090#1091#1089
        FieldName = 'SDNAME'
      end>
    Properties.ListSource = DataSource6
    Properties.OnChange = cxLookupComboBox3PropertiesChange
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -16
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 14
    Width = 290
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterClose = qPeopleAfterClose
    AfterOpen = qPeopleAfterOpen
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    IIF (P.PSEX = 0, '#39#1052#39', '#39#1046#39') AS SEX,'
      
        '       FIRST_VIZIT.Min_data, LAST_VIZIT.MAX_data, PH.PPIMAGE, DS' +
        '.DSIMAGE,'
      '       SD.SDNAME AS tsel_posl_viz, PV1.PVID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN '
      '('
      'SELECT PV.PID, MIN(PV.PVTIME_IN) AS Min_data'
      'FROM P_VIZIT PV'
      'WHERE PV.PVTIME_OUT IS NOT NULL'
      'GROUP BY 1'
      ') AS FIRST_VIZIT ON FIRST_VIZIT.PID = P.PID'
      'LEFT OUTER JOIN '
      '('
      'SELECT PV.PID, MAX(PV.PVTIME_IN) AS MAX_data'
      'FROM P_VIZIT PV'
      'WHERE PV.PVTIME_OUT IS NOT NULL'
      'GROUP BY 1'
      ') AS LAST_VIZIT ON LAST_VIZIT.PID = P.PID'
      
        'LEFT OUTER JOIN P_VIZIT PV2 ON PV2.PID = P.PID AND Pv2.PVTIME_IN' +
        ' = LAST_VIZIT.MAX_data AND PV2.PVTIME_OUT IS NOT NULL'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PV2.PVTARGET'
      
        'LEFT OUTER JOIN P_VIZIT PV1 ON PV1.PID = P.PID AND PV1.PVTIME_IN' +
        ' < CURRENT_TIMESTAMP AND PV1.PVTIME_OUT IS NULL'
      'LEFT OUTER JOIN P_PHOTOS PH ON ph.PID = p.PID'
      
        'LEFT OUTER JOIN P_DOCUMENTS PD ON PD.PID = P.PID AND PD.DMAINDOC' +
        ' = 1 AND PD.DISDELETE IS NULL'
      'LEFT OUTER JOIN D_SCAN DS ON DS.DID = PD.DID'
      'WHERE P.PISDELETE IS NULL '
      'AND UPPER(P.PLASTNAME) CONTAINING UPPER(:param) '
      'ORDER BY 2')
    Left = 288
    Top = 2
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'param'
        ParamType = ptUnknown
      end>
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleSEX: TIBStringField
      FieldName = 'SEX'
      ProviderFlags = []
      FixedChar = True
      Size = 1
    end
    object qPeopleMAX_DATA: TDateTimeField
      FieldName = 'MAX_DATA'
      ProviderFlags = []
    end
    object qPeopleMIN_DATA: TDateTimeField
      FieldName = 'MIN_DATA'
      ProviderFlags = []
    end
    object qPeoplePPIMAGE: TBlobField
      FieldName = 'PPIMAGE'
      Origin = '"P_PHOTOS"."PPIMAGE"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object qPeopleDSIMAGE: TBlobField
      FieldName = 'DSIMAGE'
      Origin = '"D_SCAN"."DSIMAGE"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object qPeopleTSEL_POSL_VIZ: TIBStringField
      DisplayLabel = #1062#1077#1083#1100' '#1087#1086#1089#1083'. '#1074#1080#1079#1080#1090#1072
      FieldName = 'TSEL_POSL_VIZ'
      ProviderFlags = []
      Size = 255
    end
    object qPeoplePVID: TIntegerField
      FieldName = 'PVID'
      Origin = '"P_VIZIT"."PVID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
  end
  object quPeople: TIBUpdateSQL
    RefreshSQL.Strings = (
      'null;')
    InsertSQL.Strings = (
      '')
    DeleteSQL.Strings = (
      'update PEOPLE'
      'set'
      ''
      '  PISDELETE = 1'
      ''
      'where'
      '  PID = :OLD_PID'
      '')
    Left = 320
    Top = 2
  end
  object DataSource1: TDataSource
    DataSet = qSearchP
    Left = 528
    Top = 72
  end
  object dsContInfo: TDataSource
    DataSet = qContInfo
    Left = 200
    Top = 629
  end
  object qContInfo: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT CI.*, SD.SDNAME'
      'FROM CONTACTINFO CI'
      'INNER JOIN SYS_DIC SD ON SD.SDID = CI.CITYPE'
      'WHERE CI.PID = :PID')
    GeneratorField.Field = 'CIID'
    Left = 224
    Top = 629
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qContInfoCIID: TIntegerField
      FieldName = 'CIID'
      Origin = '"CONTACTINFO"."CIID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qContInfoPID: TIntegerField
      FieldName = 'PID'
      Origin = '"CONTACTINFO"."PID"'
      Required = True
    end
    object qContInfoCITYPE: TIntegerField
      FieldName = 'CITYPE'
      Origin = '"CONTACTINFO"."CITYPE"'
    end
    object qContInfoCIVALUE: TIBStringField
      DisplayLabel = #1047#1085#1072#1095#1077#1085#1080#1077
      FieldName = 'CIVALUE'
      Origin = '"CONTACTINFO"."CIVALUE"'
      Size = 255
    end
    object qContInfoCINOTE: TIBStringField
      DisplayLabel = #1055#1088#1080#1084#1077#1095#1072#1085#1080#1077
      FieldName = 'CINOTE'
      Origin = '"CONTACTINFO"."CINOTE"'
      Size = 255
    end
    object qContInfoCIUSERENTER: TIBStringField
      DisplayLabel = #1044#1086#1073#1072#1074#1080#1083
      FieldName = 'CIUSERENTER'
      Origin = '"CONTACTINFO"."CIUSERENTER"'
      Size = 40
    end
    object qContInfoCITIMEENTER: TDateTimeField
      DisplayLabel = #1044#1086#1073#1072#1074#1083#1077#1085#1086
      FieldName = 'CITIMEENTER'
      Origin = '"CONTACTINFO"."CITIMEENTER"'
    end
    object qContInfoCIUSEREDIT: TIBStringField
      DisplayLabel = #1048#1079#1084#1077#1085#1080#1083
      FieldName = 'CIUSEREDIT'
      Origin = '"CONTACTINFO"."CIUSEREDIT"'
      Size = 40
    end
    object qContInfoCITIMEEDIT: TDateTimeField
      DisplayLabel = #1048#1079#1084#1077#1085#1077#1085#1086
      FieldName = 'CITIMEEDIT'
      Origin = '"CONTACTINFO"."CITIMEEDIT"'
    end
    object qContInfoSDNAME: TIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object dsComments: TDataSource
    DataSet = qComments
    Left = 592
    Top = 629
  end
  object qComments: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT C.*,  (P.PLASTNAME||'#39' '#39'||SUBSTRING(P.PNAME FROM 1 FOR 1 )' +
        '||'#39'. '#39'||'
      
        '     COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')) A' +
        'S fio, CAST(C.CTIMEENTER AS DATE) AS DATA'
      'FROM S_COMMENTS C'
      'INNER JOIN USERS U ON U.USNAME = C.CUSERENTER'
      'INNER JOIN PEOPLE P ON P.PID = U.PID'
      'WHERE C.PID = :PID')
    GeneratorField.Field = 'CID'
    Left = 560
    Top = 629
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qCommentsCID: TIntegerField
      FieldName = 'CID'
      Origin = '"S_COMMENTS"."CID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qCommentsPID: TIntegerField
      FieldName = 'PID'
      Origin = '"S_COMMENTS"."PID"'
    end
    object qCommentsCVALUE: TIBStringField
      FieldName = 'CVALUE'
      Origin = '"S_COMMENTS"."CVALUE"'
      Size = 255
    end
    object qCommentsCUSERENTER: TIBStringField
      FieldName = 'CUSERENTER'
      Origin = '"S_COMMENTS"."CUSERENTER"'
      Size = 40
    end
    object qCommentsCTIMEENTER: TDateTimeField
      FieldName = 'CTIMEENTER'
      Origin = '"S_COMMENTS"."CTIMEENTER"'
    end
    object qCommentsCUSEREDIT: TIBStringField
      FieldName = 'CUSEREDIT'
      Origin = '"S_COMMENTS"."CUSEREDIT"'
      Size = 40
    end
    object qCommentsCTIMEEDIT: TDateTimeField
      FieldName = 'CTIMEEDIT'
      Origin = '"S_COMMENTS"."CTIMEEDIT"'
    end
    object qCommentsFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qCommentsDATA: TDateField
      FieldName = 'DATA'
      ProviderFlags = []
    end
  end
  object qDov: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterOpen = qDovAfterOpen
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT (P.PLASTNAME||'#39' '#39'||P.PNAME) AS PP'
      'FROM P_STATUS PS'
      'INNER JOIN PEOPLE P ON P.PID = PS.PID'
      'WHERE PS.PID = :PID'
      '    AND ps.SDID =  1248')
    Left = 456
    Top = 405
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qDovPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 511
    end
  end
  object DataSource2: TDataSource
    DataSet = qDov
    Left = 424
    Top = 405
  end
  object qPoluch: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT (P.PLASTNAME||'#39' '#39'||P.PNAME) AS PP'
      'FROM P_STATUS PS'
      'INNER JOIN PEOPLE P ON P.PID = PS.PID'
      'WHERE PS.PID = :PID'
      '    AND ps.SDID =  1246')
    Left = 752
    Top = 453
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object IBStringField1: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 511
    end
  end
  object DataSource3: TDataSource
    DataSet = qPoluch
    Left = 720
    Top = 453
  end
  object DataSource4: TDataSource
    DataSet = qPU
    Left = 720
    Top = 493
  end
  object qPU: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = DataSource2
    SQL.Strings = (
      'SELECT DISTINCT (P.PLASTNAME||'#39' '#39'||P.PNAME) AS PP'
      'FROM AGR_POLUCH_USLUG PU'
      'INNER JOIN PEOPLE P ON P.PID = PU.PID'
      'WHERE PU.AGID = :AGID')
    Left = 752
    Top = 493
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'AGID'
        ParamType = ptUnknown
      end>
    object IBStringField2: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 511
    end
  end
  object DataSource5: TDataSource
    DataSet = qPropusk
    Left = 679
    Top = 69
  end
  object qPropusk: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 11'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      ''
      '')
    Left = 711
    Top = 71
    object qPropuskSDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qPropuskSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qPropuskSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qPropuskSDISDELETE: TIntegerField
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object qSearchP: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT DISTINCT P.PLASTNAME'
      'FROM PEOPLE P'
      'WHERE P.PISDELETE IS NULL'
      'ORDER BY 1')
    Left = 560
    Top = 74
    object qSearchPPLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
  end
  object dsDocuments: TDataSource
    DataSet = qDocuments
    Left = 968
    Top = 624
  end
  object qDocuments: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT PD.*, SD.SDID, SD.SDNAME, IIF (DS.DSID IS NULL, 0, 1) AS ' +
        'ISSCAN'
      'FROM P_DOCUMENTS PD'
      'INNER JOIN SYS_DIC SD ON SD.SDID = PD.DTYPE'
      'LEFT OUTER JOIN D_SCAN DS ON DS.DID = PD.DID'
      'WHERE PD.PID = :PID'
      '        AND PD.DISDELETE IS NULL')
    GeneratorField.Field = 'DID'
    Left = 992
    Top = 624
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qDocumentsDID: TIntegerField
      FieldName = 'DID'
      Origin = '"P_DOCUMENTS"."DID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qDocumentsPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_DOCUMENTS"."PID"'
    end
    object qDocumentsDTYPE: TIntegerField
      FieldName = 'DTYPE'
      Origin = '"P_DOCUMENTS"."DTYPE"'
    end
    object qDocumentsDSERIA: TIBStringField
      FieldName = 'DSERIA'
      Origin = '"P_DOCUMENTS"."DSERIA"'
      Size = 10
    end
    object qDocumentsDNUMBER: TIBStringField
      FieldName = 'DNUMBER'
      Origin = '"P_DOCUMENTS"."DNUMBER"'
      Size = 10
    end
    object qDocumentsDFROMWHO: TIBStringField
      FieldName = 'DFROMWHO'
      Origin = '"P_DOCUMENTS"."DFROMWHO"'
      Size = 255
    end
    object qDocumentsDDATE: TDateField
      FieldName = 'DDATE'
      Origin = '"P_DOCUMENTS"."DDATE"'
    end
    object qDocumentsDNOTE: TIBStringField
      FieldName = 'DNOTE'
      Origin = '"P_DOCUMENTS"."DNOTE"'
      Size = 255
    end
    object qDocumentsDUSERENTER: TIBStringField
      FieldName = 'DUSERENTER'
      Origin = '"P_DOCUMENTS"."DUSERENTER"'
      Size = 40
    end
    object qDocumentsDTIMEENTER: TDateTimeField
      FieldName = 'DTIMEENTER'
      Origin = '"P_DOCUMENTS"."DTIMEENTER"'
    end
    object qDocumentsDUSEREDIT: TIBStringField
      FieldName = 'DUSEREDIT'
      Origin = '"P_DOCUMENTS"."DUSEREDIT"'
      Size = 40
    end
    object qDocumentsDTIMEEDIT: TDateTimeField
      FieldName = 'DTIMEEDIT'
      Origin = '"P_DOCUMENTS"."DTIMEEDIT"'
    end
    object qDocumentsISSCAN: TIntegerField
      FieldName = 'ISSCAN'
      ProviderFlags = []
    end
    object qDocumentsDISDELETE: TIntegerField
      FieldName = 'DISDELETE'
      Origin = '"P_DOCUMENTS"."DISDELETE"'
    end
    object qDocumentsSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qDocumentsDMAINDOC: TIntegerField
      FieldName = 'DMAINDOC'
      Origin = '"P_DOCUMENTS"."DMAINDOC"'
    end
  end
  object qPVizit: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qPVizitAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT PV.*'
      'FROM P_VIZIT PV'
      'WHERE PV.PID = :pid'
      '    AND PV.PVTIME_OUT IS NULL'
      '    AND PV.PVTIME_IN IS NOT NULL')
    UpdateObject = quPVizit
    GeneratorField.Field = 'PVID'
    GeneratorField.Generator = 'GEN_P_VIZIT_ID'
    Left = 672
    Top = 42
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qPVizitPVID: TIntegerField
      FieldName = 'PVID'
      Origin = '"P_VIZIT"."PVID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPVizitPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_VIZIT"."PID"'
    end
    object qPVizitPVTARGET: TIntegerField
      FieldName = 'PVTARGET'
      Origin = '"P_VIZIT"."PVTARGET"'
    end
    object qPVizitPVTIME_IN: TDateTimeField
      FieldName = 'PVTIME_IN'
      Origin = '"P_VIZIT"."PVTIME_IN"'
    end
    object qPVizitPVTIME_OUT: TDateTimeField
      FieldName = 'PVTIME_OUT'
      Origin = '"P_VIZIT"."PVTIME_OUT"'
    end
    object qPVizitPVNOTE: TIBStringField
      FieldName = 'PVNOTE'
      Origin = '"P_VIZIT"."PVNOTE"'
      Size = 255
    end
    object qPVizitPVUSERENTER: TIBStringField
      FieldName = 'PVUSERENTER'
      Origin = '"P_VIZIT"."PVUSERENTER"'
      Size = 40
    end
    object qPVizitPVTIMEENTER: TDateTimeField
      FieldName = 'PVTIMEENTER'
      Origin = '"P_VIZIT"."PVTIMEENTER"'
    end
    object qPVizitPVUSEREDIT: TIBStringField
      FieldName = 'PVUSEREDIT'
      Origin = '"P_VIZIT"."PVUSEREDIT"'
      Size = 40
    end
    object qPVizitPVTIMEEDIT: TDateTimeField
      FieldName = 'PVTIMEEDIT'
      Origin = '"P_VIZIT"."PVTIMEEDIT"'
    end
    object qPVizitPVPRIZNAK_IN: TIntegerField
      FieldName = 'PVPRIZNAK_IN'
      Origin = '"P_VIZIT"."PVPRIZNAK_IN"'
    end
    object qPVizitPVPRIZNAK_OUT: TIntegerField
      FieldName = 'PVPRIZNAK_OUT'
      Origin = '"P_VIZIT"."PVPRIZNAK_OUT"'
    end
  end
  object quPVizit: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PVID,'
      '  PID,'
      '  PVTARGET,'
      '  PVTIME_IN,'
      '  PVTIME_OUT,'
      '  PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT,'
      '  PVNOTE,'
      '  PVUSERENTER,'
      '  PVTIMEENTER,'
      '  PVUSEREDIT,'
      '  PVTIMEEDIT'
      'from P_VIZIT '
      'where'
      '  PVID = :PVID')
    ModifySQL.Strings = (
      'update P_VIZIT'
      'set'
      '  PID = :PID,'
      '  PVID = :PVID,'
      '  PVNOTE = :PVNOTE,'
      '  PVPRIZNAK_IN = :PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT = :PVPRIZNAK_OUT,'
      '  PVTARGET = :PVTARGET,'
      '  PVTIME_IN = :PVTIME_IN,'
      '  PVTIME_OUT = :PVTIME_OUT,'
      '  PVTIMEEDIT = :PVTIMEEDIT,'
      '  PVTIMEENTER = :PVTIMEENTER,'
      '  PVUSEREDIT = :PVUSEREDIT,'
      '  PVUSERENTER = :PVUSERENTER'
      'where'
      '  PVID = :OLD_PVID')
    InsertSQL.Strings = (
      'insert into P_VIZIT'
      
        '  (PID, PVID, PVNOTE, PVPRIZNAK_IN, PVPRIZNAK_OUT, PVTARGET, PVT' +
        'IME_IN, '
      '   PVTIME_OUT, PVTIMEEDIT, PVTIMEENTER, PVUSEREDIT, PVUSERENTER)'
      'values'
      
        '  (:PID, :PVID, :PVNOTE, :PVPRIZNAK_IN, :PVPRIZNAK_OUT, :PVTARGE' +
        'T, :PVTIME_IN, '
      
        '   :PVTIME_OUT, :PVTIMEEDIT, :PVTIMEENTER, :PVUSEREDIT, :PVUSERE' +
        'NTER)')
    DeleteSQL.Strings = (
      'delete from P_VIZIT'
      'where'
      '  PVID = :OLD_PVID')
    Left = 704
    Top = 42
  end
  object qSotr: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT (P.PLASTNAME||'#39' '#39'||P.PNAME) AS PP'
      'FROM P_STATUS PS'
      'INNER JOIN PEOPLE P ON P.PID = PS.PID'
      'WHERE PS.PID = :PID'
      '    AND ps.SDID =  1249')
    Left = 1128
    Top = 405
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object IBStringField3: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 511
    end
  end
  object dsSotr: TDataSource
    DataSet = qSotr
    Left = 1096
    Top = 405
  end
  object dsInside: TDataSource
    DataSet = qInside
    Left = 88
    Top = 485
  end
  object qInside: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = DataSource6
    SQL.Strings = (
      
        'SELECT  (P.PLASTNAME||'#39' '#39'||COALESCE(SUBSTRING(P.PNAME FROM 1 FOR' +
        ' 1 )||'#39'. '#39', '#39' '#39')||'
      
        '     COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')) A' +
        'S fio, PV.PVTIME_IN'
      'FROM P_VIZIT PV'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = PV.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'WHERE PV.PVTIME_OUT IS NULL AND PV.PVTIME_IN IS NOT NULL'
      '    AND PS.SDID = :SDID')
    UpdateObject = IBUpdateSQL1
    GeneratorField.Field = 'CIID'
    Left = 112
    Top = 485
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'SDID'
        ParamType = ptUnknown
      end>
    object qInsideFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qInsidePVTIME_IN: TDateTimeField
      FieldName = 'PVTIME_IN'
      Origin = '"P_VIZIT"."PVTIME_IN"'
    end
  end
  object DataSource6: TDataSource
    DataSet = IBQuery1
    Left = 184
    Top = 437
  end
  object IBQuery1: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT t1.*'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 12'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE NOT EXISTS'
      '('
      'SELECT t2.sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 12'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t2'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE t2.sdparid = t1.sdid'
      ')')
    GeneratorField.Field = 'CIID'
    Left = 216
    Top = 437
    object IBQuery1SDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object IBQuery1SDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object IBQuery1SDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
  end
  object IBUpdateSQL1: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PVID,'
      '  PID,'
      '  PVTARGET,'
      '  PVTIME_IN,'
      '  PVTIME_OUT,'
      '  PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT,'
      '  PVNOTE,'
      '  PVUSERENTER,'
      '  PVTIMEENTER,'
      '  PVUSEREDIT,'
      '  PVTIMEEDIT'
      'from P_VIZIT '
      'where'
      '  PVID = :PVID')
    ModifySQL.Strings = (
      'update P_VIZIT'
      'set'
      '  PID = :PID,'
      '  PVID = :PVID,'
      '  PVNOTE = :PVNOTE,'
      '  PVPRIZNAK_IN = :PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT = :PVPRIZNAK_OUT,'
      '  PVTARGET = :PVTARGET,'
      '  PVTIME_IN = :PVTIME_IN,'
      '  PVTIME_OUT = :PVTIME_OUT,'
      '  PVTIMEEDIT = :PVTIMEEDIT,'
      '  PVTIMEENTER = :PVTIMEENTER,'
      '  PVUSEREDIT = :PVUSEREDIT,'
      '  PVUSERENTER = :PVUSERENTER'
      'where'
      '  PVID = :OLD_PVID')
    InsertSQL.Strings = (
      'insert into P_VIZIT'
      
        '  (PID, PVID, PVNOTE, PVPRIZNAK_IN, PVPRIZNAK_OUT, PVTARGET, PVT' +
        'IME_IN, '
      '   PVTIME_OUT, PVTIMEEDIT, PVTIMEENTER, PVUSEREDIT, PVUSERENTER)'
      'values'
      
        '  (:PID, :PVID, :PVNOTE, :PVPRIZNAK_IN, :PVPRIZNAK_OUT, :PVTARGE' +
        'T, :PVTIME_IN, '
      
        '   :PVTIME_OUT, :PVTIMEEDIT, :PVTIMEENTER, :PVUSEREDIT, :PVUSERE' +
        'NTER)')
    DeleteSQL.Strings = (
      'delete from P_VIZIT'
      'where'
      '  PVID = :OLD_PVID')
    Left = 144
    Top = 488
  end
end
